<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/avatar.jpg?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/avatar.jpg?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/avatar.jpg?v=5.1.3">


  <link rel="mask-icon" href="/images/avatar.jpg?v=5.1.3" color="#222">





  <meta name="keywords" content="机器学习,逻辑回归,广义线性模型,GLM," />










<meta name="description" content="1 问题来源记得一开始学逻辑回归时候也不知道当时怎么想得，很自然就接受了逻辑回归的决策函数——sigmod函数: h_{\theta}(x)=\frac {1}{1+e^{-\theta^Tx}}与此同时，有些书上直接给出了该函数与将 $y$ 视为类后验概率估计 $p(y=1|x)$ 等价，即  \begin{array}{lcr} p(y=1|x)=\frac {e^{\theta^T x}}{">
<meta name="keywords" content="机器学习,逻辑回归,广义线性模型,GLM">
<meta property="og:type" content="article">
<meta property="og:title" content="从广义线性模型(GLM)理解逻辑回归">
<meta property="og:url" content="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/index.html">
<meta property="og:site_name" content="Fighter&#39;s Blog">
<meta property="og:description" content="1 问题来源记得一开始学逻辑回归时候也不知道当时怎么想得，很自然就接受了逻辑回归的决策函数——sigmod函数: h_{\theta}(x)=\frac {1}{1+e^{-\theta^Tx}}与此同时，有些书上直接给出了该函数与将 $y$ 视为类后验概率估计 $p(y=1|x)$ 等价，即  \begin{array}{lcr} p(y=1|x)=\frac {e^{\theta^T x}}{">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/高斯分布对数似然.png">
<meta property="og:updated_time" content="2017-12-25T14:11:49.071Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="从广义线性模型(GLM)理解逻辑回归">
<meta name="twitter:description" content="1 问题来源记得一开始学逻辑回归时候也不知道当时怎么想得，很自然就接受了逻辑回归的决策函数——sigmod函数: h_{\theta}(x)=\frac {1}{1+e^{-\theta^Tx}}与此同时，有些书上直接给出了该函数与将 $y$ 视为类后验概率估计 $p(y=1|x)$ 等价，即  \begin{array}{lcr} p(y=1|x)=\frac {e^{\theta^T x}}{">
<meta name="twitter:image" content="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/高斯分布对数似然.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/"/>





  <title>从广义线性模型(GLM)理解逻辑回归 | Fighter's Blog</title><!-- hexo-inject:begin --><!-- hexo-inject:end -->
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Fighter's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">深度沉迷学习</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Fighter.">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Fighter's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">从广义线性模型(GLM)理解逻辑回归</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-12-24T22:03:18+08:00">
                2017-12-24
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/机器学习笔记/" itemprop="url" rel="index">
                    <span itemprop="name">机器学习笔记</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
            </span>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="1-问题来源"><a href="#1-问题来源" class="headerlink" title="1 问题来源"></a>1 问题来源</h2><p>记得一开始学逻辑回归时候也不知道当时怎么想得，很自然就接受了逻辑回归的决策函数——sigmod函数:</p>
<script type="math/tex; mode=display">h_{\theta}(x)=\frac {1}{1+e^{-\theta^Tx}}</script><p>与此同时，有些书上直接给出了该函数与将 $y$ 视为类后验概率估计 $p(y=1|x)$ 等价，即</p>
<script type="math/tex; mode=display">
\begin{array}{lcr}
p(y=1|x)=\frac {e^{\theta^T x}}{1+e^{\theta^T x}}\\ \\
p(y=0|x)=\frac {1}{1+e^{\theta^T x}}
\end{array}</script><p>并给出了二分类(标签 $y\in(0,1)$)情况下的判别方式：</p>
<script type="math/tex; mode=display">y=\left\{
\begin{array}{lcl}
1                            &    &  {h_{\theta}(x) \geq 0.5}\\
0                         &    &  {h_{\theta}(x) < 0.5}
\end{array} \right.</script><p>但今天再回过头看的时候，突然就不理解了，一个函数值是怎么和一个概率联系起来了呢？有些人解释说因为 $h_{\theta}(x)$ 范围在0~1之间啊，可是数值在此之间还是没说明白和概率究竟有什么关系。所以，前几天看了一些资料，对个人而言比较好理解的还是从广义线性模型（Generalized Linear Models, GLM）来解释，至少这种方法能从概率出发直接推出 sigmod 函数。实际上，线性回归和逻辑回归都是广义线性模型的特例，从此出发，得到对应的决策函数就比较自然了。<br><a id="more"></a></p>
<h2 id="2-指数分布族"><a href="#2-指数分布族" class="headerlink" title="2 指数分布族"></a>2 指数分布族</h2><p>在介绍广义线性模型之前不得不先说一下“指数分布族”，因为指数分布族是广义线性模型所提出的假设之一。<br>指数分布族中的一类分布都可以用下述公式描述：</p>
<script type="math/tex; mode=display">p(y;\eta) = b(y)\ exp(\eta^T T(y)-a(\eta))</script><p>下面是公式中的参数：（可以通过后面具体例子的推导来理解）</p>
<ul>
<li>η：分布的自然参数（也就是说跟分布有关）</li>
<li>T(y)：充分统计量（通常 T(y)=y）</li>
<li>a(η)：log partition function，$e^{-a(\eta)}$ 本质上起着规范化常数的作用，保证概率分布 $\sum p(y;\eta)$ 为1</li>
</ul>
<p>当T、a、b固定之后实际上就确定了指数分布族中的一种分布模型，就得到了以$\eta$为参数的模型。</p>
<p>其实，大多数的概率分布都属于指数分布族：</p>
<ul>
<li>伯努利分布（Bernoulli）：对 0、1 问题进行建模；</li>
<li>二项分布（Multinomial）：对 K 个离散结果的事件建模；</li>
<li>泊松分布（Poisson）：对计数过程进行建模，比如网站访问量的计数问题，放射性衰变的数目，商店顾客数量等问题；</li>
<li>伽马分布（gamma）与指数分布（exponential）：对有间隔的正数进行建模，比如公交车的到站时间问题；</li>
<li>β 分布：对小数建模；</li>
<li>Dirichlet 分布：对概率分布进建模；</li>
<li>Wishart 分布：协方差矩阵的分布；</li>
<li>高斯分布（Gaussian）</li>
</ul>
<p>知道了这么多的指数分布族之后其实我们已经能够求解一些问题了，求解的方法就是将<strong>概率分布符合上述指数分布族</strong>的转换成它对应的指数分布族的形式，求出指数分布族对应位置上的参数即可求出原模型的参数。</p>
<h2 id="3-广义线性模型"><a href="#3-广义线性模型" class="headerlink" title="3 广义线性模型"></a>3 广义线性模型</h2><p>为了给问题构造GLM模型，必须首先知道GLM为作出的三个假设：</p>
<blockquote>
<ol>
<li>$y|x;θ \sim ExponentialFamily(\eta)$。比如，给定样本$x$与参数$\theta$，样本的分类$y$服从以 $\eta$ 为参数的指数分布族中的某个分布</li>
<li>给定$x$，广义线性模型的目标是求解 $T(y)|x$，不过由于很多情况下 $T(y) = y$ 所以我们的目标变成了求 $h(x) = E[y|x]$</li>
<li>$\eta=\theta^Tx$</li>
</ol>
</blockquote>
<p>这些假设看起来似乎很神奇，比如第三条，但这就是GLM的假设（说成“设计”更合理），从这三个假设出发能得到一类很好的学习算法。下面就来展示一下如何从GLM推导出逻辑回归和线性回归。</p>
<h3 id="3-1-GLM与逻辑回归"><a href="#3-1-GLM与逻辑回归" class="headerlink" title="3.1 GLM与逻辑回归"></a>3.1 GLM与逻辑回归</h3><p>接下来按照上面GLM作出的假设条件来推导逻辑回归。</p>
<ul>
<li>对于二分类问题，很自然想到$y$服从伯努利分布，满足第一个假设，即$y|x;\theta \sim Bernoulli(\phi)$</li>
<li>第二个假设很重要，是求决策函数的。因此我们要求$E[y|x;\theta]$。对于伯努利分布来说，$p(y=1|x;\theta)=\phi$，$p(y=0|x;\theta))=1-\phi$。因此有：</li>
</ul>
<script type="math/tex; mode=display">\begin{equation}\begin{split}
p(y;\phi)&=\phi^y(1-\phi)^{1-y}\\
&=exp(log\phi^y(1-\phi)^{1-y})\\
&=exp(ylog\phi+(1-y)log(1-\phi))\\
&=exp(log(\frac{\phi}{1-\phi})y+log(1-\phi))
\end{split}\end{equation}</script><p>参照指数分布族的标准形式，可以得到：</p>
<blockquote>
<p>$b(y)=1$<br>$T(y)=y$<br>$\eta=log(\frac{\phi}{1-\phi})y$，进而得到$\phi=\frac{1}{1+e^{-\eta}}$<br>$a(\eta)=-log(1-\phi)=log(1+e^\eta)$</p>
</blockquote>
<p>再根据第三个假设条件$\eta=\theta^Tx$，得到 $\phi=\frac{1}{1+e^{-\eta}}=\frac{1}{1+e^{-\theta^Tx}}$，即 $p(y=1|x;\theta)=\frac{1}{1+e^{-\theta^Tx}}$，这样就将概率和 sigmod 函数联系起来了。</p>
<p>到这里，GLM已经解决了概率和sigmod函数之间关系的疑惑了。</p>
<h3 id="3-2-GLM与线性回归"><a href="#3-2-GLM与线性回归" class="headerlink" title="3.2 GLM与线性回归"></a>3.2 GLM与线性回归</h3><ul>
<li>在线性回归中，我们对概率分布作出的假设是 $y|x;\theta \sim N(\mu,\sigma^2)$</li>
<li>接下来求 $h_{\theta}(x)=E[y|x;\theta]$。对于高斯分布，从概率角度是通过极大似然法来求，可以发现最后的结果是不受$\sigma$影响的，因此可以将$\sigma$设为1。（原因如下所示）</li>
</ul>
<img src="/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/高斯分布对数似然.png" title="对数极大似然">
<p>等价于：</p>
<script type="math/tex; mode=display">min \ \ \frac{1}{2}\sum_{1}^{m}(y^{(i)}-\theta^Tx^{(i)})^2</script><p>所以我们从 $y|x;\theta \sim N(\mu,1)$ 出发来推导:</p>
<script type="math/tex; mode=display">
\begin{equation}\begin{split}
p(y;\mu)&=\frac{1}{\sqrt{2\pi}}exp(-\frac{1}{2}(y-\mu)^2)\\
&=\frac{1}{\sqrt{2\pi}}exp(-\frac{1}{2}y^2)exp(\mu y-\frac{1}{2}\mu^2)
\end{split}\end{equation}</script><p>通刚才一样，参照指数分布族的标准形式，可以得到：</p>
<blockquote>
<p>$b(y)=\frac{1}{\sqrt{2\pi}}exp(-\frac{y^2}{2})$<br>$T(y)=y$<br>$\eta=\mu$<br>$a(\eta)=\frac{\mu^2}{2}=\frac{\eta^2}{2}$</p>
</blockquote>
<p>再根据第三个假设条件，即可得到线性回归模型 $h_{\theta}(x)=E[y|x;\theta]=\mu=\eta=\theta^Tx$</p>
<p>综上所述，广义线性模型GLM是通过假设一个概率分布并将其化成指数分布族形式，从而得到不同的模型，这对理解模型的由来很有帮助。</p>
<p>参考：<br>CS229 Andrew Ng</p>

      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>请我喝杯咖啡吧☕~</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.jpg" alt="Fighter. 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="Fighter. 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    Fighter.
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/" title="从广义线性模型(GLM)理解逻辑回归">http://fighterhit.github.io/2017/12/24/machine_learning_notes/从广义线性模型理解逻辑回归/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/机器学习/" rel="tag"># 机器学习</a>
          
            <a href="/tags/逻辑回归/" rel="tag"># 逻辑回归</a>
          
            <a href="/tags/广义线性模型/" rel="tag"># 广义线性模型</a>
          
            <a href="/tags/GLM/" rel="tag"># GLM</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/11/12/other_notes/Hadoop-安装和使用/" rel="next" title="Hadoop 安装和使用">
                <i class="fa fa-chevron-left"></i> Hadoop 安装和使用
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/12/26/algorithm_and_datastructure/二分查找/" rel="prev" title="你真的会二分查找吗？">
                你真的会二分查找吗？ <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_tsina">新浪微博</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_cqq">腾讯QQ</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          
  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zMjY0Ni85MjA3"></div>
    </div>
  


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/avatar.jpg"
                alt="Fighter." />
            
              <p class="site-author-name" itemprop="name">Fighter.</p>
              <p class="site-description motion-element" itemprop="description">学习 | 分享 | 交流 | 进步</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">26</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">28</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          <div class="links-of-author motion-element">
            
              
                <span class="links-of-author-item">
                  <a href="https://github.com/fighterhit" target="_blank" title="GitHub">
                    
                      <i class="fa fa-fw fa-github"></i>GitHub</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://weibo.com/fighterhit" target="_blank" title="Weibo">
                    
                      <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                </span>
              
            
          </div>

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-问题来源"><span class="nav-number">1.</span> <span class="nav-text">1 问题来源</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-指数分布族"><span class="nav-number">2.</span> <span class="nav-text">2 指数分布族</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-广义线性模型"><span class="nav-number">3.</span> <span class="nav-text">3 广义线性模型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-GLM与逻辑回归"><span class="nav-number">3.1.</span> <span class="nav-text">3.1 GLM与逻辑回归</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-GLM与线性回归"><span class="nav-number">3.2.</span> <span class="nav-text">3.2 GLM与线性回归</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
      
    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2016 - <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-home"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Fighter.</span>

  
</div>









        
<div class="busuanzi-count">
  <!--<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>-->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  

    <span class="site-pv">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
    Hosted by <a target="_blank" href="https://github.com/">GitHub Pages</a>
    </span>

</div>







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.3"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  








  





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script><!-- hexo-inject:begin --><!-- hexo-inject:end -->
  


  

  

</body>
</html>
